package com.example.myapplication1;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.TextView;

import java.security.SecurityPermission;

public class MainActivity extends AppCompatActivity {

    private TextView etMain;
    String prefName = "com.example.myapplication1";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        etMain = (TextView) findViewById(R.id.et_main);

        Intent intent1 = getIntent();
        String username = intent1.getStringExtra("username");
        UserIfnfo userIfnfo = new UserIfnfo(intent1.getStringExtra("username"),
                intent1.getStringExtra("password"),
                intent1.getIntExtra("age",0),
                intent1.getBooleanExtra("gender",false));

        etMain.setText("用户名：" + userIfnfo.username+
                "\r\n密码：" + userIfnfo.password+
                "\n年龄：" + userIfnfo.age+
                "\n性别：" + (userIfnfo.gender?"男":"女"));
    }

}